#include <iostream>
#include <vector>

using namespace std;
void dis(vector<int>& dest)
{
    for (int x : dest)
    {
        cout << x << " ";
    }
    cout << endl;
}
void rotate(vector<int>& nums, int k)
{
    // 1 2 3 4 5 6 7 1 2 3 4 5 6 7 end
    k %= nums.size();
    if (k > 0)
    {
        nums.insert(nums.begin(), nums.end() - k, nums.end());
        nums.erase(nums.end() - k, nums.end());
    }
}

int main()
{
    vector<int> tmp{ 1, 2, 3, 4, 5, 6 };
    rotate(tmp, 1);
    dis(tmp);
	return 0;
}